<?php
header("Content-Type: text/html; charset=utf-8",true);

include_once("../models/cls.capa.php");
$oCapa = new capa();

$i = 1000;
foreach( $_GET['listItem'] as $position => $item )
{
	$i-=10;
	$sql = "UPDATE pagina SET ordem='" . $i . "' WHERE id = '" . $item . "'";
	$oCapa->update_ordem( $sql );

}
$hora = date("H:i:s");
echo "Ordem atualizada em: " . $hora;
?>